package com.alan.chat;

import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

/**
 * 升级版服务端
 * Created by Alan on 2017/8/5.
 */
public class Server {

    public static void main(String[] args) {
        //创建一个服务器对象
        ServerSocket serverSocket = null;
        Socket socket = null;
        try {
            serverSocket = new ServerSocket(8888);
            
            //服务器进入就绪状态
            socket = serverSocket.accept();
            Send send = new Send(socket,"system");
            Receive receive = new Receive(socket);
            send.start();
            receive.start();

        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
